// JavaScript Document
var aneObj=function()
{
	//起始点 控制点 结束点
	this.rootx={};
	this.headx=[];
	this.heady=[];
	this.amp=[];
	this.alpha=0;
		
}
aneObj.prototype.num=50;
aneObj.prototype.init=function()
{
	var h=can1.height;
		for(var i=0;i<this.num;i++)
		{
			this.rootx[i]=i*16+Math.random()*20; //[0,1]
			this.headx[i]=this.rootx[i]
			this.heady[i]=canHeight-230+Math.random()*50;
			this.amp[i]=Math.random()*50+30
			
	
		}
		
}
aneObj.prototype.draw=function()
{	
		this.alpha+=deltaTime*0.0009
		var l=Math.sin(this.alpha)
		ctx2.save()
		ctx2.globalAlpha=0.6
		ctx2.lineWidth=20
		ctx2.lineCap="round";
		ctx2.strokeStyle="#3b154e"
		for(var i=0;i<this.num;i++)
		{
				//beginPath开始,moveTo开始点,lineTo下个点位子,strokeStyle线段颜色，lineWidth线段宽度,lineCap,globalAlpha透明度
				
				ctx2.beginPath();
				ctx2.moveTo(this.rootx[i],canHeight)
				this.headx[i]=this.rootx[i]+l*this.amp[i];
				ctx2.quadraticCurveTo(this.rootx[i],canHeight-100,this.headx[i],this.heady[i]);
				
				ctx2.stroke()
		}
		ctx2.restore()
}